import { type DefaultTheme } from 'vitepress'
import { withMermaid, UserConfig } from 'vitepress-plugin-mermaid'
import { MermaidConfig } from 'mermaid/dist/config.type'
import { MermaidPluginConfig } from 'vitepress-plugin-mermaid/dist/mermaid-plugin'
import { nav,sidebar } from './router'

const mermaid :MermaidConfig=  {
  theme: 'default',
    darkMode: true,
    logLevel: 'info',
    fontSize: 20
};
const mermaidPlugin:MermaidPluginConfig={
}

export default withMermaid({
  mermaidPlugin,
  mermaid,
  lang: 'zh_CN',
  title: 'elsfs-cloud-doc',
  titleTemplate: true,
  description: 'elsfs, admin,cloud',
  head: [
    ['link', { rel: 'icon', type: 'svg', href: '/images/logo.svg' }],
    ['meta', { name: 'og:type', content: 'website' }],
    ['meta', { name: 'og:locale', content: 'zh_CN' }],
    ['meta', { name: 'og:site_name', content: 'elsfs' }]
  ],
  srcDir: 'src',
  appearance: true,
  lastUpdated: true,
  cleanUrls: true,
  markdown: {
    math: true,
    container: {
      tipLabel: '提示',
      warningLabel: '警告',
      dangerLabel: '危险',
      infoLabel: '信息',
      detailsLabel: '详细信息'
    }
  },
  vite: {
    // 定义全局变量替换。条目将在开发期间在窗口中定义，并在构建期间替换。
    define: {
      __VUE_OPTIONS_API__: false
    },
    server: {
      host: true
    },
    build: {
      minify: 'terser',
      chunkSizeWarningLimit: Infinity
    },
    json: {
      stringify: true
    }
  },
  sitemap: {
    hostname: 'https://elsfs.gitee.io'
  },
  themeConfig: {
    logo: { src: '/images/logo.svg', width: 24, height: 24 },
    // 导航菜单项的配置
    nav: nav(),
    // 侧边栏菜单项的配置
    sidebar: sidebar(),
    socialLinks: [
      { icon: 'github', link: 'https://github.com/elsfs/elsfs-cloud' }
    ],
    footer: {
      message: '版权声明',
      copyright: '本文档采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议  (CC BY-NC-SA 4.0) 进行许可。'
    },
    search: {
      provider: 'local',
      options: {
        disableQueryPersistence: true,
        detailedView: 'auto'
      }
    }

  }
})
